﻿namespace ImapComponent.Net.Mail.Imap4
{
    /// <summary>
    /// Represents the set of message flags.
    /// </summary>
    public class MessageFlagSet
    {
        #region Fields

        private readonly string[] allFlags;
        private readonly SystemMessageFlags systemFlags;

        #endregion // Fields

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the MessageFlagSet class.
        /// </summary>
        private MessageFlagSet(string[] allFlags, SystemMessageFlags systemFlags)
        {
            this.allFlags = allFlags;
            this.systemFlags = systemFlags;
        }

        /// <summary>
        /// Factory method.
        /// </summary>
        public static MessageFlagSet CreateMessageFlagSet(string[] allFlags, SystemMessageFlags systemFlags)
        {
            return new MessageFlagSet(allFlags, systemFlags);
        }

        #endregion // Constructors

        #region Properties

        /// <summary>
        /// Gets all flags, system flags are prefixed with '\'.
        /// </summary>
        public string[] AllFlags
        {
            get
            {
                return this.allFlags;
            }
        }

        /// <summary>
        /// Gets the system flags.
        /// </summary>
        public SystemMessageFlags SystemFlags
        {
            get
            {
                return this.systemFlags;
            }
        }

        #endregion // Properties
    }
}
